import React, { Component } from 'react';
import {
  StyleSheet, View, Text, Keyboard, 
  Image, StatusBar, BackHandler, 
  KeyboardAvoidingView, DeviceEventEmitter,
} from 'react-native';
import SplashScreen from 'react-native-splash-screen';
import { Actions } from 'react-native-router-flux';

class Welcome extends Component {
  async componentDidMount() {
    setTimeout(() => {
      SplashScreen.hide();
      Actions.replace('login');
    }, 200);
  }

  checkAuth = async () => {
    // const userToken = await Storage.get(Prefs.USER_COOKIE);
    // const user = await Storage.get(Prefs.USER_DATA_KEY);
    // const permissions =   await Storage.get(Prefs.USER_PERMISSION);
    // const modules = await Storage.get(Prefs.USER_MODULES);
    // if (userToken&&userToken.length && user && permissions && modules) {
    //   UserUtil.setGlobalUser(user);
    //   UserUtil.setGlobalModules(modules);
    //   UserUtil.setGlobalPermissions(permissions);
    //   Actions.replace('main');
    //   DeviceEventEmitter.emit("checkNotification");
    // } else {
       Actions.replace('login');
    // }
  }

  render() {
      return <Text>1111</Text>;
    }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'red',
  },
});

export default Welcome;
